package com.sdx.console.content.service;

import java.util.List;

import com.ibeetl.admin.core.entity.BaseEntity;
import com.sdx.console.customer.entity.CustomerInfo;
import org.beetl.sql.core.engine.PageQuery;
import javax.annotation.Resource;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.ibeetl.admin.core.util.PlatformException;

import com.sdx.console.content.dao.ResContentMainDao;
import com.sdx.console.content.entity.ResContentMain;
import com.ibeetl.admin.core.service.BaseService;

/**
 * ResContentMain Service
 */

@Service
@Transactional
public class ResContentMainService extends BaseService<ResContentMain>{

    @Resource
	private ResContentMainDao resContentMainDao;

    public PageQuery<ResContentMain>queryByCondition(PageQuery query){
        PageQuery ret =  resContentMainDao.queryByCondition(query);
        queryListAfter(ret.getList());
        return ret;
    }

    public void batchDelResContentMain(List<String> ids){
        try {
            resContentMainDao.batchDelResContentMainByIds(ids);
        } catch (Exception e) {
            throw new PlatformException("批量删除ResContentMain失败", e);
        }
    }

    public List<ResContentMain> queryByProvinceId(String provinceId){
        try {
            return resContentMainDao.queryByProvinceId(provinceId);
        } catch (Exception e) {
            e.printStackTrace();
        }
        return  null;
    }

    public List<BaseEntity> selectAuthor(Integer provinceId){
        return resContentMainDao.selectAuthor(provinceId);
    }




}